Skip to content

feat(platform): expose callback_context on Runs.submit() [PYSDK-143]#660

Merged
arne-aignx merged 2 commits into
mainfrom
feat/update-api-layer-1.6.0
May 28, 2026
Merged

feat(platform): expose callback_context on Runs.submit() [PYSDK-143]#660
arne-aignx merged 2 commits into
mainfrom
feat/update-api-layer-1.6.0

Conversation

@arne-aignx
Copy link
Copy Markdown
Collaborator

@arne-aignx arne-aignx commented May 28, 2026

Summary

Implements CR PYSDK-143: exposes the new optional callback_context field on run submission, introduced by Platform API v1.6.0.

  • Codegen regen — pulled v1.6.0 OpenAPI spec from platform-staging; RunCreationRequest now carries callback_context: Optional[Dict[str, Any]] = None. Unrelated v1.6.0 deltas (new grants/share-token models) are accepted as part of the regen.
  • Platform moduleRuns.submit() gains a callback_context: dict[str, Any] | None = None kwarg, forwarded verbatim to RunCreationRequest. No client-side validation; server enforces the 1 KB limit.
  • Tests — two new @pytest.mark.unit cases in tests/aignostics/platform/resources/runs_test.py: forwards-when-provided and defaults-to-None.
  • SPECspecifications/SPEC_PLATFORM_SERVICE.md amended to document the new param on Runs.create().
  • Out of scope (per CR): CLI, GUI, and the application service orchestration layer are intentionally unchanged.

Traceability

Per the updated CR, only SPEC-level items are affected:

The change is implementation-level passthrough — no SWR-level amendments needed (captured at the SPEC layer).

Test plan

  • make lint — green
  • uv run pytest tests/aignostics/platform/resources/runs_test.py — 60/60 pass
  • make test_unit — green
  • CI matrix (3.11 / 3.12 / 3.13 / 3.14)
  • E2E smoke against staging — confirm platform echoes callback_context on a submitted run
  • make audit — supply-chain check

🤖 Generated with Claude Code

Picks up the new optional callback_context field on RunCreationRequest
plus unrelated v1.6.0 deltas (grants/share-tokens models). Driven entirely
by openapi-generator output from platform-staging — no hand edits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@arne-aignx arne-aignx requested a review from a team as a code owner May 28, 2026 12:25
Copilot AI review requested due to automatic review settings May 28, 2026 12:25
@arne-aignx arne-aignx added enhancement New feature or request python Pull requests that update python code skip:test:long_running Skip long-running tests (≥5min) labels May 28, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes the new optional callback_context field (added in Platform API v1.6.0) on the low-level platform.Runs.submit() method. The field is forwarded verbatim into the generated RunCreationRequest; server enforces the 1 KB cap, no client-side validation. The PR also pulls in the v1.6.0 codegen regen (which incidentally brings new grants/share-token models/endpoints and optional share_token query params on run read APIs).

Changes:

  • Adds callback_context: dict[str, Any] | None = None kwarg to Runs.submit() and forwards it to RunCreationRequest.
  • Regenerates codegen/out/aignx/codegen/* from OpenAPI v1.6.0 (new callback_context field on RunCreationRequest, plus unrelated grants/share-tokens models and share_token query params).
  • Updates SPEC and adds two unit tests covering forward-when-provided and default-to-None.

Reviewed changes

Copilot reviewed 4 out of 59 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/aignostics/platform/resources/runs.py Adds and forwards callback_context kwarg on Runs.submit()
tests/aignostics/platform/resources/runs_test.py Adds two unit tests + assertion in existing test for callback_context
specifications/SPEC_PLATFORM_SERVICE.md Documents the new param on Runs.create() (note: spec still uses create, impl is submit)
codegen/in/openapi.json, codegen/in/archive/openapi_1.6.0.json OpenAPI source bumped to v1.6.0 with callback_context and access/share-token additions
codegen/out/aignx/codegen/models/run_creation_request.py Generated model gains callback_context field and to_dict/from_dict handling
codegen/out/aignx/codegen/models/{grant_,share_token_,resource_type,subject_type}.py New generated models for access/share-token endpoints (regen side-effect)
codegen/out/aignx/codegen/models/init.py Re-exports for new generated models
codegen/out/aignx/codegen/api/public_api.py (and docs/PublicApi.md) Generated endpoints for grants/share-tokens and optional share_token query param on run read APIs
codegen/out/aignx/codegen/{api_client,configuration,exceptions,rest}.py & other model headers Version banner bump from 1.5.0 to 1.6.0
codegen/out/.openapi-generator/FILES Generator file list updated

Comment thread specifications/SPEC_PLATFORM_SERVICE.md Outdated
Surfaces the optional v1.6.0 callback_context field as a dict | None kwarg
on Runs.submit(), forwarded verbatim to RunCreationRequest. The platform
echoes it in state-change events; useful for callers (e.g. internal
orchestrators) embedding correlation data. No client-side validation —
server enforces the 1 KB limit.

CLI, GUI, and the application service orchestration layer are intentionally
unchanged per CR PYSDK-143.

- src/aignostics/platform/resources/runs.py: add parameter + payload kwarg
- tests/aignostics/platform/resources/runs_test.py: forwards-when-provided
  and omits-when-not-provided unit tests; extend existing test
- specifications/SPEC_PLATFORM_SERVICE.md: amend Runs.create() signature

Refs: https://aignx.atlassian.net/browse/PYSDK-143

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@arne-aignx arne-aignx force-pushed the feat/update-api-layer-1.6.0 branch from feca4cb to abb59cf Compare May 28, 2026 12:33
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

❗ There is a different number of reports uploaded between BASE (9def2c5) and HEAD (abb59cf). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (9def2c5) HEAD (abb59cf)
3 1
Files with missing lines Coverage Δ
src/aignostics/platform/resources/runs.py 83.94% <100.00%> (-0.73%) ⬇️

... and 21 files with indirect coverage changes

@arne-aignx arne-aignx merged commit 8139b34 into main May 28, 2026
27 of 29 checks passed
@arne-aignx arne-aignx deleted the feat/update-api-layer-1.6.0 branch May 28, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update python code skip:test:long_running Skip long-running tests (≥5min)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants